<template>
  <div>
    <van-card v-for="(item,index) in list" :key="index"
              :desc="item.desc"
              :title="item.title"
              :thumb='item.houseImg'
              :lazy-load="true"
              @click="onDetail(index)"
    >
      <template #tags>
        <div class="youdian">{{item.tags[0]}}</div>
        <div class="price">{{item.price}}<span>元/月</span></div>
      </template>
    </van-card>
  </div>
</template>

<script>
export default {
  name: 'house-mudule',
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    onDetail (index) {
      this.$router.push({
        path: '/detail',
        query: {
          id: this.list[index].houseCode
        }
      })
    }
  }
}
</script>

<style lang='less' scoped>
.van-card:not(:first-child){
  margin-top: 0;
  border-bottom: 1px solid #e3dbdb;
  background: white;
}
.youdian{
  color: #76cee1;
  background-color: #e1f5f8;
  width: 46px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  border-radius: 3px;
}
/deep/ .van-card__title{
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}
.price{
  position: relative;
  top: 4px;
  font-size: 16px;
  font-weight: bolder;
  color: #fa5741;
  span{
    font-size: 12px;
    font-weight: normal;
    padding-left: 4px;
  }
}
</style>
